# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-parse-recdescent
_realname=Parse-RecDescent
pkgver=1.967015
pkgrel=5
pkgdesc="Generate Recursive-Descent Parsers"
url="https://metacpan.org/dist/Parse-RecDescent"
arch="noarch"
license="Artistic-Perl-1.0 GPL+"
depends="perl"
checkdepends="perl-test-pod perl-test-warn"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/J/JT/JTBRAUN/$_realname-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

prepare() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="
38adbfc9a88f09d0465d862b845f48c0921ce462ffccaa7ce8b5f1b7090f33f70e7f00f9ee787fd698b5539804412c44f03e7942cf675d53a17a84c3510e5aa4  Parse-RecDescent-1.967015.tar.gz
"
